package com.rockcent.mall.lib.dto;

import com.rockcent.common.domain.DtoEntity;
import com.rockcent.common.domain.enumclass.Whether;
import com.rockcent.common.utils.BigDecimalUtils;
import com.rockcent.mall.lib.domain.enumclass.SellPath;
import org.apache.commons.lang3.StringUtils;

import java.math.BigDecimal;
import java.util.Date;

/**
 * Created by DK on 16/11/9.
 */
public class MerchantOrderItemDto extends DtoEntity {

    /**
     * 商家订单 id
     */
    private Long merchantOrderId;
    /**
     * 商家订单号
     */
    private String merchantOrderNum;
    /**
     * 商家 id'
     */
    private Long merchantId;
    /**
     * 产品 id
     */
    private Long productId;
    /**
     * 产品名称
     */
    private String productName;
    /**
     * 产品图片
     */
    private String logoUrl;
    /**
     * 产品过期退时间
     */
    private Date productDateDisabled;
    /**
     * 是否支持过期退 YES("是"), NO("否")
     */
    private Whether productRefundable;
    /**
     * 是否已执行自动退款
     */
    private Boolean productRefundableIsRun;
    /**
     * 产品分销佣金
     */
    private BigDecimal resellFee;
    /**
     * 产品分享返利
     */
    private BigDecimal shareFee;
    /**
     * 服务费比率
     */
    private String serveRate;
    /**
     * M/D分享比率
     */
    private String shareRate;
    /**
     * 产品单价
     */
    private BigDecimal singleAmount;
    /**
     * 购买数量
     */
    private Long buyCount;
    /**
     * 合计金额
     */
    private BigDecimal totalAmount;
    /**
     * 平台id
     */
    private Long mallId;
    /**
     * 平台订单号
     */
    private String mallOrderNum;
    /**
     * 关联门店id
     */
    private Long merchantStoreId;
    /**
     * 分享码
     */
    private String shareCode;
    /**
     * 分享者id
     */
    private String sharerId;

    /**
     * 分享者昵称
     */
    private String sharerNickName;

    /**
     * 分销码
     */
    private String salesCode;

    /**
     * 分销商账号
     */
    private String resellerAcct;

    /**
     * 分销商名称
     */
    private String resellerName;

    /**
     * 渠道
     */
    private String channel;

    /**
     * 分销商名称
     */
    private String channelName;
    /**
     * 销售路径
     */
    private SellPath sellPath;
    /**
     * 分销产品门店信息
     */
    private String extStoreId;
    /**
     * 优惠券id
     */
    private Long couponId;
    /**
     * 核销数量
     */
    private Long verifyCount;
    /**
     * 平台服务费比率
     */
    private String mallServiceFeeRates;
    /**
     * 产品类型
     */
    private String type;
    /**
     * 物流方式
     */
    private String ShoppingType;

    //结算状态
    private String settleStatus;

    //实付金额
    private BigDecimal DiscountAmount;

    //订单来源
    private String pathType;

    //原价
    private BigDecimal baseAmount;

    //商家角色。当订单为分销订单时,用于区分供应商或者分销商
    private String merchantRole;

    //分销订单号
    private String marketOrderNum;

    //供应商 id
    private Long supplierMerchantId;

    //供应商 名称
    private String supplierMerchantName;

    //分销商 id
    private Long distributorMerchantId;

    //分销商 名称
    private String distributorMerchantName;

    //购买者
    private String customerName;

    //结算时间
    private Date dateSettled;

    //礼包名称
    private String giftName;

    public String getShippingType() {
        return ShoppingType;
    }

    public void setShoppingType(String shippingType) {
        ShoppingType = shippingType;
    }

    public String getMerchantOrderNum() {
        return merchantOrderNum;
    }

    public void setMerchantOrderNum(String merchantOrderNum) {
        this.merchantOrderNum = merchantOrderNum;
    }

    public Long getMerchantOrderId() {
        return merchantOrderId;
    }

    public void setMerchantOrderId(Long merchantOrderId) {
        this.merchantOrderId = merchantOrderId;
    }

    public Long getProductId() {
        return productId;
    }

    public void setProductId(Long productId) {
        this.productId = productId;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public String getLogoUrl() {
        return logoUrl;
    }

    public void setLogoUrl(String logoUrl) {
        this.logoUrl = logoUrl;
    }

    public Date getProductDateDisabled() {
        return productDateDisabled;
    }

    public void setProductDateDisabled(Date productDateDisabled) {
        this.productDateDisabled = productDateDisabled;
    }


    public Boolean getProductRefundableIsRun() {
        return productRefundableIsRun;
    }

    public void setProductRefundableIsRun(Boolean productRefundableIsRun) {
        this.productRefundableIsRun = productRefundableIsRun;
    }

    public Whether getProductRefundable() {
        return productRefundable;
    }

    public void setProductRefundable(Whether productRefundable) {
        this.productRefundable = productRefundable;
    }

    public BigDecimal getResellFee() {
        return resellFee;
    }

    public void setResellFee(BigDecimal resellFee) {
        this.resellFee = resellFee;
    }

    public BigDecimal getShareFee() {
        return shareFee;
    }

    public void setShareFee(BigDecimal shareFee) {
        this.shareFee = shareFee;
    }

    public String getServeRate() {
        return StringUtils.isEmpty(serveRate)?null:String.valueOf(BigDecimalUtils.setScale(Double.valueOf(serveRate)));
    }

    public void setServeRate(String serveRate) {
        this.serveRate = serveRate;
    }

    public String getShareRate() {
        return shareRate;
    }

    public void setShareRate(String shareRate) {
        this.shareRate = shareRate;
    }

    public BigDecimal getSingleAmount() {
        return singleAmount;
    }

    public void setSingleAmount(BigDecimal singleAmount) {
        this.singleAmount = singleAmount;
    }

    public Long getBuyCount() {
        return buyCount;
    }

    public void setBuyCount(Long buyCount) {
        this.buyCount = buyCount;
    }

    public BigDecimal getTotalAmount() {
        return totalAmount;
    }

    public void setTotalAmount(BigDecimal totalAmount) {
        this.totalAmount = totalAmount;
    }

    public Long getMallId() {
        return mallId;
    }

    public void setMallId(Long mallId) {
        this.mallId = mallId;
    }

    public String getMallOrderNum() {
        return mallOrderNum;
    }

    public void setMallOrderNum(String mallOrderNum) {
        this.mallOrderNum = mallOrderNum;
    }

    public Long getMerchantStoreId() {
        return merchantStoreId;
    }

    public void setMerchantStoreId(Long merchantStoreId) {
        this.merchantStoreId = merchantStoreId;
    }

    public String getShareCode() {
        return shareCode;
    }

    public void setShareCode(String shareCode) {
        this.shareCode = shareCode;
    }

    public String getSharerId() {
        return sharerId;
    }

    public void setSharerId(String sharerId) {
        this.sharerId = sharerId;
    }

    public String getSharerNickName() {
        return sharerNickName;
    }

    public void setSharerNickName(String sharerNickName) {
        this.sharerNickName = sharerNickName;
    }

    public String getSalesCode() {
        return salesCode;
    }

    public void setSalesCode(String salesCode) {
        this.salesCode = salesCode;
    }

    public String getResellerAcct() {
        return resellerAcct;
    }

    public void setResellerAcct(String resellerAcct) {
        this.resellerAcct = resellerAcct;
    }

    public String getResellerName() {
        return resellerName;
    }

    public void setResellerName(String resellerName) {
        this.resellerName = resellerName;
    }

    public String getChannel() {
        return channel;
    }

    public void setChannel(String channel) {
        this.channel = channel;
    }

    public String getChannelName() {
        return channelName;
    }

    public void setChannelName(String channelName) {
        this.channelName = channelName;
    }

    public SellPath getSellPath() {
        return sellPath;
    }

    public void setSellPath(SellPath sellPath) {
        this.sellPath = sellPath;
    }

    public String getExtStoreId() {
        return extStoreId;
    }

    public void setExtStoreId(String extStoreId) {
        this.extStoreId = extStoreId;
    }

    public Long getCouponId() {
        return couponId;
    }

    public void setCouponId(Long couponId) {
        this.couponId = couponId;
    }

    public Long getMerchantId() {
        return merchantId;
    }

    public void setMerchantId(Long merchantId) {
        this.merchantId = merchantId;
    }

    public Long getVerifyCount() {
        return verifyCount;
    }

    public void setVerifyCount(Long verifyCount) {
        this.verifyCount = verifyCount;
    }

    public String getMallServiceFeeRates() {
        return mallServiceFeeRates;
    }

    public void setMallServiceFeeRates(String mallServiceFeeRates) {
        this.mallServiceFeeRates = mallServiceFeeRates;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getSettleStatus() {
        return settleStatus;
    }

    public void setSettleStatus(String settleStatus) {
        this.settleStatus = settleStatus;
    }

    public BigDecimal getDiscountAmount() {
        return DiscountAmount==null?null:DiscountAmount.setScale(2, BigDecimal.ROUND_HALF_UP);
    }

    public void setDiscountAmount(BigDecimal discountAmount) {
        DiscountAmount = discountAmount;
    }

    public String getPathType() {
        return pathType;
    }

    public void setPathType(String pathType) {
        this.pathType = pathType;
    }

    public BigDecimal getBaseAmount() {
        return baseAmount==null?null:baseAmount.setScale(2, BigDecimal.ROUND_HALF_UP);
    }

    public void setBaseAmount(BigDecimal baseAmount) {
        this.baseAmount = baseAmount;
    }

    public String getMerchantRole() {
        return merchantRole;
    }

    public void setMerchantRole(String merchantRole) {
        this.merchantRole = merchantRole;
    }

    public String getMarketOrderNum() {
        return marketOrderNum;
    }

    public void setMarketOrderNum(String marketOrderNum) {
        this.marketOrderNum = marketOrderNum;
    }

    public Long getSupplierMerchantId() {
        return supplierMerchantId;
    }

    public void setSupplierMerchantId(Long supplierMerchantId) {
        this.supplierMerchantId = supplierMerchantId;
    }

    public String getSupplierMerchantName() {
        return supplierMerchantName;
    }

    public void setSupplierMerchantName(String supplierMerchantName) {
        this.supplierMerchantName = supplierMerchantName;
    }

    public Long getDistributorMerchantId() {
        return distributorMerchantId;
    }

    public void setDistributorMerchantId(Long distributorMerchantId) {
        this.distributorMerchantId = distributorMerchantId;
    }

    public String getDistributorMerchantName() {
        return distributorMerchantName;
    }

    public void setDistributorMerchantName(String distributorMerchantName) {
        this.distributorMerchantName = distributorMerchantName;
    }

    public String getCustomerName() {
        return customerName;
    }

    public void setCustomerName(String customerName) {
        this.customerName = customerName;
    }

    public Date getDateSettled() {
        return dateSettled;
    }

    public void setDateSettled(Date dateSettled) {
        this.dateSettled = dateSettled;
    }

    public String getGiftName() {
        return giftName;
    }

    public void setGiftName(String giftName) {
        this.giftName = giftName;
    }

    @Override
    public String toString() {
        return "MerchantOrderItemDto{" +
                "merchantOrderId=" + merchantOrderId +
                ", merchantOrderNum='" + merchantOrderNum + '\'' +
                ", merchantId=" + merchantId +
                ", productId=" + productId +
                ", productName='" + productName + '\'' +
                ", logoUrl='" + logoUrl + '\'' +
                ", productDateDisabled=" + productDateDisabled +
                ", productRefundable=" + productRefundable +
                ", productRefundableIsRun=" + productRefundableIsRun +
                ", resellFee=" + resellFee +
                ", shareFee=" + shareFee +
                ", serveRate='" + serveRate + '\'' +
                ", shareRate='" + shareRate + '\'' +
                ", singleAmount=" + singleAmount +
                ", buyCount=" + buyCount +
                ", totalAmount=" + totalAmount +
                ", mallId=" + mallId +
                ", mallOrderNum='" + mallOrderNum + '\'' +
                ", merchantStoreId=" + merchantStoreId +
                ", shareCode='" + shareCode + '\'' +
                ", sharerId='" + sharerId + '\'' +
                ", sharerNickName='" + sharerNickName + '\'' +
                ", salesCode='" + salesCode + '\'' +
                ", resellerAcct='" + resellerAcct + '\'' +
                ", resellerName='" + resellerName + '\'' +
                ", channel='" + channel + '\'' +
                ", channelName='" + channelName + '\'' +
                ", sellPath=" + sellPath +
                ", extStoreId='" + extStoreId + '\'' +
                ", couponId=" + couponId +
                ", verifyCount=" + verifyCount +
                ", mallServiceFeeRates='" + mallServiceFeeRates + '\'' +
                ", type='" + type + '\'' +
                ", ShoppingType='" + ShoppingType + '\'' +
                ", settleStatus='" + settleStatus + '\'' +
                ", DiscountAmount=" + DiscountAmount +
                ", pathType='" + pathType + '\'' +
                ", baseAmount=" + baseAmount +
                ", merchantRole='" + merchantRole + '\'' +
                ", marketOrderNum='" + marketOrderNum + '\'' +
                ", supplierMerchantId=" + supplierMerchantId +
                ", supplierMerchantName='" + supplierMerchantName + '\'' +
                ", distributorMerchantId=" + distributorMerchantId +
                ", distributorMerchantName='" + distributorMerchantName + '\'' +
                ", customerName='" + customerName + '\'' +
                '}';
    }
}
